@Test public void rollThenGetFaceValue() { context.checking(new Expectations() { { one(testDoubleDie).roll(); one(testDoubleDie).getFaceValue(); } }); testDoubleDie.roll(); testDoubleDie.getFaceValue(); }
Withdrawal withdrawal; Mockery context = new Mockery(); BankAccount account; @Before public void initialize() { withdrawal = new Withdrawal(); withdrawal.setAmount(1500); account = context.mock(BankAccount.class); withdrawal.setAccount(account); }
You need to enable Javascript in your browser to edit pages.
help on how to format text
Verify a sequence of methods
This test method exists in a jMock JUnit 4 Die Skeleton.Make sure that the testDoubleDie method will first have its roll() method called exactly once and then its getFaceValue() method called exactly once():
Common fixture for the test
<--Back